{extend name="base" /}
{block name="body"}
<style>
    .nav01{
        font-size:16px;
        float: left;
        padding: 11px;
        position: relative;
        top: -40px;
        left: 20%;
    }
</style>
<script src="__JS__/jquery.min.js"></script>
<script>
    $(function() {
        $(".ids").click(function() {
            var aa = document.getElementsByName("ids");
            var ss = "";
            for (var i = 0; i < aa.length; i++) {
                if (aa[i].checked) {
                    ss += aa[i].value+',';
                }
            }
            $('#sid').attr('value',ss);
        });
        $(".check-all").click(function() {
            var aa = document.getElementsByName("ids");
            var ss = "";
            for (var i = 0; i < aa.length; i++) {
                if (aa[i].checked) {
                    ss += aa[i].value+',';
                }
            }
            $('#sid').attr('value',ss);
        });
    })

    function select(){
        var a = $("#sid").val();
        var b = $("#cid").val();
        $.ajax({
            "url":"{:url('admin/photo/actionSelect')}",
            "type":"post",
            "data":"selectVal=" + a + "&&cid=" + b,
            "dataType":"json",
            success:function(response){
                if(response){
                    alert(response);
                }
            }
        });
    }
</script>

<div class="layui-body">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui-this">图片管理</li>
            <li class=""><a href="{:url('admin/photo/add')}">添加图片</a></li>
        </ul>
        <div class="layui-tab-content">
            <hr>
            <form action="" method="post" class="ajax-form">
                <ul class="layui-nav">
                    <li class="layui-nav-item layui-this">
                        <a href="javascript:;">分类</a>
                        <dl class="layui-nav-child">
                            <dd><a href = "{:url('photo/index')}">全部</a></dd>
                            {foreach name="nav_level_list" item="v"}
                            <dd><a href = "{:url('photo/nav',array('cid'=>$v['id']))}">{$v.name}</a></dd>
                            {/foreach}
                        </dl>
                    </li>
                </ul>
                <div class="layui-tab-item layui-show">
                    <table class="layui-table">
                        <thead>
                        <tr>
                            <th style="width: 15px;"><input type="checkbox" class="check-all"></th>
                            <th style="width: 30px;">ID</th>

                            <th>标题</th>
                            <th>分类</th>
                            <th>作者</th>
                            <th>是否显示</th>

                            <th>发布时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {foreach name="article_list" item="vo"}
                        <tr>
                            <td><input type="checkbox" name="ids" value="{$vo.id}" class="ids"></td>
                            <td>{$vo.id}</td>

                            <td>{$vo.title}</td>
                            <td>{$vo.name}</td>
                            <td>{$vo.author}</td>

                            <td>{php}echo $vo['status']==1 ? '不显示' : '显示';{/php}</td>
                            <td>{$vo.create_time|date="Y-m-d H:i:s",###}</td>
                            <td>
                                <a href="{:url('admin/photo/edit',['id'=>$vo['id']])}" class="layui-btn layui-btn-normal layui-btn-mini">编辑</a>
                                <a href="{:url('admin/photo/delete',['id'=>$vo['id']])}" class="layui-btn layui-btn-danger layui-btn-mini ajax-delete">删除</a>
                            </td>
                        </tr>
                        {/foreach}
                        </tbody>
                    </table>
                    <!--分页-->

                </div>
            </form>
            <div>{$article_list->render()}</div>
        </div>
    </div>
</div>
{/block}